#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   App_ReadDTCInfomation_0x19_06_test.py
@Time    :   2025/04/07 13:31:28
@Author  :   YangLiang
@Version :   1.0
@Contact :   yangl@genvict.com
@License :   (C)Copyright 2022-2025
@Desc    :   None
'''

# here put the import lib
from gettext import find
# from lib2to3.pgen2 import driver
from re import X
from urllib import response
from pytest_assume.plugin import assume

import pytest
import logging
import time
import requests
from sympy import I
# from sympy import assuming
from commDriver.TS_CAN import *
import allure
import sys
from collections.abc import Iterable

from sqlalchemy import false
sys.dont_write_bytecode = True
import Set_up


class Test_APP_DTCSnapshotRecordNUM_phy(object):

   ids = ["Request {0}".format(binascii.b2a_hex(bytearray(dtcNumber), ' '), dtcName) for dtcNumber, dtcName in Set_up.DTC_list]
   @allure.severity('normal')
   @allure.title('物理寻址-默认会话-测试DTC扩展数据记录-01')
   @allure.description('测试物理寻址默认会话下的DTC扩展数据记录-01')
   @pytest.mark.parametrize('dtcNumber,dtcName', Set_up.DTC_list, ids=ids)
   def test_NoFault_DTCExtended_Data_01_Default_Phy(self, action, Driver, dtcNumber,dtcName):
      iStep = 1
      req =  [0x19,0x06] + dtcNumber + [0x01]
      if dtcNumber == [0xC2,0x6C,0x87] or dtcNumber == [0xA1,0x43,0x50]:
         resp = [0x59,0x06] + dtcNumber
      else:
         resp = [0x59,0x06] + dtcNumber + [0x00]
      logging.info(f"Test [{dtcName}:{dtcNumber}]  by SID_0x19-Subfunction_0x06-DTCExtendedDataRecordNumb_01")
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 1, iStep, False, 'UDS', 'ClearFault')

   ids = ["Request {0}".format(binascii.b2a_hex(bytearray(dtcNumber), ' '), dtcName) for dtcNumber, dtcName in Set_up.DTC_list]
   @allure.severity('normal')
   @allure.title('物理寻址-扩展会话-测试DTC扩展数据记录-01')
   @allure.description('测试物理寻址扩展会话下的DTC扩展数据记录-01')
   @pytest.mark.parametrize('dtcNumber,dtcName', Set_up.DTC_list, ids=ids)
   def test_NoFault_DTCExtended_Data_01_Extended_Phy(self, action, Driver, dtcNumber,dtcName):
      iStep = 1
      req =  [0x19,0x06] + dtcNumber + [0x01]
      if dtcNumber == [0xC2,0x6C,0x87] or dtcNumber == [0xA1,0x43,0x50]:
         resp = [0x59,0x06] + dtcNumber
      else:
         resp = [0x59,0x06] + dtcNumber + [0x00]
      logging.info(f"Test [{dtcName}:{dtcNumber}]  by SID_0x19-Subfunction_0x06-DTCExtendedDataRecordNumb_01")
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 3, iStep, False, 'UDS', 'ClearFault')

   ids = ["Request {0}".format(binascii.b2a_hex(bytearray(dtcNumber), ' '), dtcName) for dtcNumber, dtcName in Set_up.DTC_list]
   @allure.severity('normal')
   @allure.title('物理寻址-默认会话-测试DTC扩展数据记录-02')
   @allure.description('测试物理寻址默认会话下的DTC扩展数据记录-02')
   @pytest.mark.parametrize('dtcNumber, dtcName', Set_up.DTC_list, ids=ids)
   def test_NoFault_DTCExtended_Data_02_Default_Phy(self, action, Driver, dtcNumber, dtcName):
      iStep = 1
      req =  [0x19,0x06] + dtcNumber + [0x02]
      if dtcNumber == [0xC2,0x6C,0x87] or dtcNumber == [0xA1,0x43,0x50]:
         resp = [0x59,0x06] + dtcNumber
      else:
         resp = [0x59,0x06] + dtcNumber + [0x00]
      logging.info(f"Test [{dtcName}] by SID_0x19-Subfunction_0x06-DTCExtendedDataRecordNumb_02")
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 1, iStep, False, 'UDS', 'ClearFault')

   ids = ["Request {0}".format(binascii.b2a_hex(bytearray(dtcNumber), ' '), dtcName) for dtcNumber, dtcName in Set_up.DTC_list]
   @allure.severity('normal')
   @allure.title('物理寻址-扩展会话-测试DTC扩展数据记录-02')
   @allure.description('测试物理寻址扩展会话下的DTC扩展数据记录-02')
   @pytest.mark.parametrize('dtcNumber, dtcName', Set_up.DTC_list, ids=ids)
   def test_NoFault_DTCExtended_Data_02_Extended_Phy(self, action, Driver, dtcNumber, dtcName):
      iStep = 1
      req =  [0x19,0x06] + dtcNumber + [0x02]
      if dtcNumber == [0xC2,0x6C,0x87] or dtcNumber == [0xA1,0x43,0x50]:
         resp = [0x59,0x06] + dtcNumber
      else:
         resp = [0x59,0x06] + dtcNumber + [0x00]
      logging.info(f"Test [{dtcName}] by SID_0x19-Subfunction_0x06-DTCExtendedDataRecordNumb_02")
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 3, iStep, False, 'UDS', 'ClearFault')

   # @allure.severity('normal')
   # @allure.title('物理寻址-默认会话-测试DTC扩展数据记录-FF')
   # @allure.description('测试物理寻址默认会话下的DTC扩展数据记录-FF')
   # @pytest.mark.parametrize('dtcNumber,dtcName', Set_up.DTC_list, ids=ids)
   # def test_NoFault_DTCExtended_Data_FF_Default_Phy(self, action, Driver, dtcNumber,dtcName):
   #    iStep = 1
   #    req =  [0x19,0x06] + dtcNumber + [0xFF]
   #    if dtcNumber == [0xC2,0x6C,0x87] or dtcNumber == [0xA1,0x43,0x50]:
   #       resp = [0x59,0x06] + dtcNumber
   #    else:
   #       resp = [0x59,0x06] + dtcNumber + [0x00]
   #    time.sleep(0.5)
   #    logging.info(f"Test [{dtcName}] by SID_0x19-Subfunction_0x06-DTCExtendedDataRecordNumb_FF")
   #    iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 1, iStep, False, 'UDS', 'ClearFault')


   # @allure.severity('normal')
   # @allure.title('物理寻址-扩展会话-测试DTC扩展数据记录-FF')
   # @allure.description('测试物理寻址扩展会话下的DTC扩展数据记录-FF')
   # @pytest.mark.parametrize('dtcNumber,dtcName', Set_up.DTC_list, ids=ids)
   # def test_NoFault_DTCExtended_Data_FF_Extended_Phy(self, action, Driver, dtcNumber,dtcName):
   #    iStep = 1
   #    time.sleep(0.5)
   #    req =  [0x19,0x06] + dtcNumber + [0xFF]
   #    if dtcNumber == [0xC2,0x6C,0x87] or dtcNumber == [0xA1,0x43,0x50]:
   #       resp = [0x59,0x06] + dtcNumber
   #    else:
   #       resp = [0x59,0x06] + dtcNumber + [0x00]
   #    logging.info(f"Test [{dtcName}] by SID_0x19-Subfunction_0x06-DTCExtendedDataRecordNumb_FF")
   #    iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 3, iStep, False, 'UDS', 'ClearFault')

   @allure.severity('normal')
   @allure.title('物理寻址-默认会话-测试DTC扩展老化数据-OCC1')
   @allure.description('测试物理寻址默认会话下的DTC扩展数据记录-OCC1')
   def test_DTCS_OCC1_Defaul_Phy(self, action, Driver):
      iStep = 1
      logging.info('Wait 1.5s')
      time.sleep(1.5)
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 00', 1, iStep, False, 'UDS', 'ClearFault')
      
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 09 01 01', 0, iStep)

      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 01', 0, iStep) 

      iStep = Driver['CAN'].restartETC_11(Driver,iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 01', 0, iStep)
     
      for i in range(3):
         # 设置电压为8v,生成低压故障
         iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
         iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 09 01 ' + format(i+2, '02X'), 0, iStep)
         # 设置电压为12v,恢复低压故障
         iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
         iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 ' + format(i+2, '02X'), 0, iStep) 

      iStep = Driver['CAN'].restartETC_11(Driver,iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 04', 0, iStep)
      
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '14 FF FF FF', '54', 0, iStep)
      time.sleep(2)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 00', 0, iStep)

   @allure.severity('normal')
   @allure.title('物理寻址-扩展会话-测试DTC扩展老化数据-OCC1')
   @allure.description('测试物理寻址扩展会话下的DTC扩展数据记录-OCC1')
   def test_DTCS_OCC1_Extended_Phy(self, action, Driver):
      iStep = 1
      logging.info('Wait 1.5s')
      time.sleep(1.5)
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 00', 3, iStep, False, 'UDS', 'ClearFault')
      
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 09 01 01', 0, iStep)

      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 01', 0, iStep) 

      iStep = Driver['CAN'].restartETC_11(Driver,iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 01', 3, iStep)
     
      for i in range(3):
         # 设置电压为8v,生成低压故障
         iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
         iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 09 01 ' + format(i+2, '02X'), 0, iStep)
         # 设置电压为12v,恢复低压故障
         iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
         iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 ' + format(i+2, '02X'), 0, iStep) 

      iStep = Driver['CAN'].restartETC_11(Driver,iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 04', 3, iStep)
      
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '14 FF FF FF', '54', 0, iStep)
      time.sleep(2)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 00', 0, iStep)

   @allure.severity('normal')
   @allure.title('物理寻址-默认会话-测试DTC扩展老化数据-OCC1-老化计数器255')
   @allure.description('测试物理寻址默认会话下的DTC扩展数据记录-OCC1-老化计数器255')
   def test_DTCS_OccurrenceCounter_255_Defaul_Phy(self, action, Driver):
      iStep = 1
      logging.info('Wait 1.5s')
      time.sleep(1.5)
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 00', 1, iStep, False, 'UDS', 'ClearFault')
      
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 09 01 01', 0, iStep)
      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 01', 0, iStep) 
      iStep = Driver['CAN'].restartETC_11(Driver,iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 01', 0, iStep)
      for i in range(255):
         # 设置电压为8v,生成低压故障
         iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
         if i > 253:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 09 01 FF', 0, iStep)
         else:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 09 01'+ format(i+2, '02X'), 0, iStep)
         # 设置电压为12v,恢复低压故障
         iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
         if i > 253:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 FF', 0, iStep)
         else:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 ' + format(i+2, '02X'), 0, iStep) 

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '14 FF FF FF', '54', 0, iStep)
      time.sleep(2)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 00', 0, iStep)

   @allure.severity('normal')
   @allure.title('物理寻址-默认会话-测试DTC扩展老化数据-老化计数器')
   @allure.description('测试物理寻址默认会话下的DTC扩展数据记录-老化计数器')
   def test_DTCS_Failureforgetcounter_Defaul_Phy(self, action, Driver):
      iStep = 1
      logging.info('Wait 1.5s')
      time.sleep(1.5)
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 1, iStep, False, 'UDS', 'ClearFault')
      
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 09 02 00', 0, iStep)
      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 2, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 00', 0, iStep)

      iStep = Driver['CAN'].restartETC_11(Driver,iStep, 3)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 01', 0, iStep)

      for i in range(3):
         # ECU下电再次上电
         iStep = Driver['CAN'].restartETC_11(Driver,iStep, 3)
         iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 ' + format(i+2, '02X'), 0, iStep)

      iStep = Driver['CAN'].restartETC_11(Driver,iStep, 3)
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 09 02 00', 0, iStep)
      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 2, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 00', 0, iStep)

      iStep = Driver['CAN'].restartETC_11(Driver,iStep, 3)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 01', 0, iStep)
      
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '14 FF FF FF', '54', 0, iStep)
      time.sleep(2)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 0, iStep)

   
   @allure.severity('normal')
   @allure.title('物理寻址-扩展会话-测试DTC扩展老化数据-老化计数器')
   @allure.description('测试物理寻址扩展会话下的DTC扩展数据记录-老化计数器')
   def test_DTCS_Failureforgetcounter_Extended_Phy(self, action, Driver):
      iStep = 1
      logging.info('Wait 1.5s')
      time.sleep(1.5)
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 3, iStep, False, 'UDS', 'ClearFault')
      
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 09 02 00', 0, iStep)
      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 2, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 00', 0, iStep)

      iStep = Driver['CAN'].restartETC_11(Driver,iStep, 3)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 01', 3, iStep)

      for i in range(3):
         # ECU下电再次上电
         iStep = Driver['CAN'].restartETC_11(Driver,iStep, 3)
         iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 ' + format(i+2, '02X'), 3, iStep)

      iStep = Driver['CAN'].restartETC_11(Driver,iStep, 3)
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 09 02 00', 3, iStep)
      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 2, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 00', 0, iStep)

      iStep = Driver['CAN'].restartETC_11(Driver,iStep, 3)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 01', 3, iStep)
      
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '14 FF FF FF', '54', 0, iStep)
      time.sleep(2)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 0, iStep)
   
   @allure.severity('normal')
   @allure.title('物理寻址-默认会话-测试DTC扩展老化数据-老化计数器-40')
   @allure.description('测试物理寻址默认会话下的DTC扩展数据记录-老化计数器-40')
   def test_DTCS_Failureforgetcounter_40_Defaul_Phy(self, action,  Driver):
      iStep = 1
      logging.info('Wait 1.5s')
      time.sleep(1.5)
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 1, iStep, False, 'UDS', 'ClearFault')
      
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 09 02 00', 0, iStep)
      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 2, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 00', 0, iStep)

      iStep = Driver['CAN'].restartETC_11(Driver,iStep, 3)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 01', 0, iStep)

      for i in range(42):
         # ECU下电再次上电
         iStep = Driver['CAN'].restartETC_11(Driver,iStep, 3)
         if i > 38:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 0, iStep)
         else:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 ' + format(i+2, '02X'), 0, iStep)
      
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '14 FF FF FF', '54', 0, iStep)
      time.sleep(2)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 0, iStep)


class Test_APP_DTCSnapshotRecordNUM_Func(object):

   ids = ["Request {0}".format(binascii.b2a_hex(bytearray(dtcNumber), ' '), dtcName) for dtcNumber, dtcName in Set_up.DTC_list]
   @allure.severity('normal')
   @allure.title('功能寻址-默认会话-测试DTC扩展数据记录-01')
   @allure.description('测试功能寻址默认会话下的DTC扩展数据记录-01')
   @pytest.mark.parametrize('dtcNumber,dtcName', Set_up.DTC_list, ids=ids)
   def test_NoFault_DTCExtended_Data_01_Default_Func(self, action, Driver, dtcNumber,dtcName):
      iStep = 1
      req =  [0x19,0x06] + dtcNumber + [0x01]
      if dtcNumber == [0xC2,0x6C,0x87] or dtcNumber == [0xA1,0x43,0x50]:
         resp = [0x59,0x06] + dtcNumber
      else:
         resp = [0x59,0x06] + dtcNumber + [0x00]
      logging.info(f"Test [{dtcName}:{dtcNumber}]  by SID_0x19-Subfunction_0x06-DTCExtendedDataRecordNumb_01")
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 1, iStep, False, 'UDSFun', 'ClearFault')

   ids = ["Request {0}".format(binascii.b2a_hex(bytearray(dtcNumber), ' '), dtcName) for dtcNumber, dtcName in Set_up.DTC_list]
   @allure.severity('normal')
   @allure.title('功能寻址-扩展会话-测试DTC扩展数据记录-01')
   @allure.description('测试功能寻址扩展会话下的DTC扩展数据记录-01')
   @pytest.mark.parametrize('dtcNumber,dtcName', Set_up.DTC_list, ids=ids)
   def test_NoFault_DTCExtended_Data_01_Extended_Func(self, action, Driver, dtcNumber,dtcName):
      iStep = 1
      req =  [0x19,0x06] + dtcNumber + [0x01]
      if dtcNumber == [0xC2,0x6C,0x87] or dtcNumber == [0xA1,0x43,0x50]:
         resp = [0x59,0x06] + dtcNumber
      else:
         resp = [0x59,0x06] + dtcNumber + [0x00]
      logging.info(f"Test [{dtcName}:{dtcNumber}]  by SID_0x19-Subfunction_0x06-DTCExtendedDataRecordNumb_01")
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 3, iStep, False, 'UDSFun', 'ClearFault')

   ids = ["Request {0}".format(binascii.b2a_hex(bytearray(dtcNumber), ' '), dtcName) for dtcNumber, dtcName in Set_up.DTC_list]
   @allure.severity('normal')
   @allure.title('功能寻址-默认会话-测试DTC扩展数据记录-02')
   @allure.description('测试功能寻址默认会话下的DTC扩展数据记录-02')
   @pytest.mark.parametrize('dtcNumber, dtcName', Set_up.DTC_list, ids=ids)
   def test_NoFault_DTCExtended_Data_02_Default_Func(self, action, Driver, dtcNumber, dtcName):
      iStep = 1
      req =  [0x19,0x06] + dtcNumber + [0x02]
      if dtcNumber == [0xC2,0x6C,0x87] or dtcNumber == [0xA1,0x43,0x50]:
         resp = [0x59,0x06] + dtcNumber
      else:
         resp = [0x59,0x06] + dtcNumber + [0x00]
      logging.info(f"Test [{dtcName}] by SID_0x19-Subfunction_0x06-DTCExtendedDataRecordNumb_02")
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 1, iStep, False, 'UDSFun', 'ClearFault')

   ids = ["Request {0}".format(binascii.b2a_hex(bytearray(dtcNumber), ' '), dtcName) for dtcNumber, dtcName in Set_up.DTC_list]
   @allure.severity('normal')
   @allure.title('功能寻址-扩展会话-测试DTC扩展数据记录-02')
   @allure.description('测试功能寻址扩展会话下的DTC扩展数据记录-02')
   @pytest.mark.parametrize('dtcNumber, dtcName', Set_up.DTC_list, ids=ids)
   def test_NoFault_DTCExtended_Data_02_Extended_Func(self, action, Driver, dtcNumber, dtcName):
      iStep = 1
      req =  [0x19,0x06] + dtcNumber + [0x02]
      if dtcNumber == [0xC2,0x6C,0x87] or dtcNumber == [0xA1,0x43,0x50]:
         resp = [0x59,0x06] + dtcNumber
      else:
         resp = [0x59,0x06] + dtcNumber + [0x00]
      logging.info(f"Test [{dtcName}] by SID_0x19-Subfunction_0x06-DTCExtendedDataRecordNumb_02")
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 3, iStep, False, 'UDSFun', 'ClearFault')

   # @allure.severity('normal')
   # @allure.title('功能寻址-默认会话-测试DTC扩展数据记录-FF')
   # @allure.description('测试功能寻址默认会话下的DTC扩展数据记录-FF')
   # @pytest.mark.parametrize('dtcNumber,dtcName', Set_up.DTC_list, ids=ids)
   # def test_NoFault_DTCExtended_Data_FF_Default_Func(self, action, Driver, dtcNumber,dtcName):
   #    iStep = 1
   #    req =  [0x19,0x06] + dtcNumber + [0xFF]
   #    if dtcNumber == [0xC2,0x6C,0x87] or dtcNumber == [0xA1,0x43,0x50]:
   #       resp = [0x59,0x06] + dtcNumber
   #    else:
   #       resp = [0x59,0x06] + dtcNumber + [0x00]
   #    time.sleep(0.5)
   #    logging.info(f"Test [{dtcName}] by SID_0x19-Subfunction_0x06-DTCExtendedDataRecordNumb_FF")
   #    iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 1, iStep, False, 'UDSFun', 'ClearFault')


   # @allure.severity('normal')
   # @allure.title('功能寻址-扩展会话-测试DTC扩展数据记录-FF')
   # @allure.description('测试功能寻址扩展会话下的DTC扩展数据记录-FF')
   # @pytest.mark.parametrize('dtcNumber,dtcName', Set_up.DTC_list, ids=ids)
   # def test_NoFault_DTCExtended_Data_FF_Extended_Func(self, action, Driver, dtcNumber,dtcName):
   #    iStep = 1
   #    time.sleep(0.5)
   #    req =  [0x19,0x06] + dtcNumber + [0xFF]
   #    if dtcNumber == [0xC2,0x6C,0x87] or dtcNumber == [0xA1,0x43,0x50]:
   #       resp = [0x59,0x06] + dtcNumber
   #    else:
   #       resp = [0x59,0x06] + dtcNumber + [0x00]
   #    logging.info(f"Test [{dtcName}] by SID_0x19-Subfunction_0x06-DTCExtendedDataRecordNumb_FF")
   #    iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 3, iStep, False, 'UDSFun', 'ClearFault')

   @allure.severity('normal')
   @allure.title('功能寻址-默认会话-测试DTC扩展老化数据-OCC1')
   @allure.description('测试功能寻址默认会话下的DTC扩展数据记录-OCC1')
   def test_DTCS_OCC1_Defaul_Func(self, action, Driver):
      iStep = 1
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 00', 1, iStep, False, 'UDSFun', 'ClearFault')
      
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 09 01 01', 0, iStep, False, 'UDSFun', 'noClearFault')

      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 3, iStep)

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 01', 0, iStep, False, 'UDSFun', 'noClearFault') 

      iStep = Driver['CAN'].restartETC_11(Driver, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 01', 0, iStep, False, 'UDSFun', 'noClearFault')
     
      for i in range(3):
         # 设置电压为8v,生成低压故障
         iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
         iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 09 01 ' + format(i+2, '02X'), 0, iStep, False, 'UDSFun', 'noClearFault')
         # 设置电压为12v,恢复低压故障
         iStep = Driver['CAN'].SetVolt(Driver, 12, 3, iStep)
         iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 ' + format(i+2, '02X'), 0, iStep, False, 'UDSFun', 'noClearFault') 

      iStep = Driver['CAN'].restartETC_11(Driver, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01',  '59 06 91 17 16 08 01 04', 0, iStep, False, 'UDSFun', 'noClearFault')
      
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '14 FF FF FF', '54', 0, iStep, False, 'UDSFun', 'noClearFault')
      time.sleep(2)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 00', 0, iStep, False, 'UDSFun', 'noClearFault')

   @allure.severity('normal')
   @allure.title('功能寻址-扩展会话-测试DTC扩展老化数据-OCC1')
   @allure.description('测试功能寻址扩展会话下的DTC扩展数据记录-OCC1')
   def test_DTCS_OCC1_Extended_Func(self, action, Driver):
      iStep = 1
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 17 01', '59 06 91 17 17 00', 3, iStep, False, 'UDSFun', 'ClearFault')
      
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 18.0, 3, iStep)

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 17 01', '59 06 91 17 17 09 01 01', 0, iStep, False, 'UDSFun', 'noClearFault')

      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 17 01', '59 06 91 17 17 08 01 01', 0, iStep, False, 'UDSFun', 'noClearFault') 

      iStep = Driver['CAN'].restartETC_11(Driver, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 17 01', '59 06 91 17 17 08 01 01', 3, iStep, False, 'UDSFun', 'noClearFault')
     
      for i in range(3):
         # 设置电压为8v,生成低压故障
         iStep = Driver['CAN'].SetVolt(Driver, 18.3, 3, iStep)
         iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 17 01', '59 06 91 17 17 09 01 ' + format(i+2, '02X'), 0, iStep, False, 'UDSFun', 'noClearFault')
         # 设置电压为12v,恢复低压故障
         iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
         iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 17 01', '59 06 91 17 17 08 01 ' + format(i+2, '02X'), 0, iStep, False, 'UDSFun', 'noClearFault') 

      iStep = Driver['CAN'].restartETC_11(Driver, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 17 01', '59 06 91 17 17 08 01 04', 3, iStep, False, 'UDSFun', 'noClearFault')
      
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '14 FF FF FF', '54', 0, iStep, False, 'UDSFun', 'noClearFault')
      time.sleep(2)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 17 01', '59 06 91 17 17 00', 0, iStep, False, 'UDSFun', 'noClearFault')

   @allure.severity('normal')
   @allure.title('功能寻址-默认会话-测试DTC扩展老化数据-OCC1-老化计数器255')
   @allure.description('测试功能寻址默认会话下的DTC扩展数据记录-OCC1-老化计数器255')
   def test_DTCS_OccurrenceCounter_255_Defaul_Func(self, action, Driver):
      iStep = 1
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 00', 1, iStep, False, 'UDSFun', 'ClearFault')
      
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 09 01 01', 0, iStep, False, 'UDSFun', 'noClearFault')
      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 01', 0, iStep, False, 'UDSFun', 'noClearFault') 
      iStep = Driver['CAN'].restartETC_11(Driver, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 01', 0, iStep, False, 'UDSFun', 'noClearFault')
      for i in range(255):
         # 设置电压为8v,生成低压故障
         iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
         if i > 253:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 09 01 FF', 0, iStep, False, 'UDSFun', 'noClearFault')
         else:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 09 01'+ format(i+2, '02X'), 0, iStep, False, 'UDSFun', 'noClearFault')
         # 设置电压为12v,恢复低压故障
         iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
         if i > 253:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 FF', 0, iStep, False, 'UDSFun', 'noClearFault')
         else:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 08 01 ' + format(i+2, '02X'), 0, iStep, False, 'UDSFun', 'noClearFault') 

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '14 FF FF FF', '54', 0, iStep, False, 'UDSFun', 'noClearFault')
      time.sleep(2)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 01', '59 06 91 17 16 00', 0, iStep, False, 'UDSFun', 'noClearFault')

   @allure.severity('normal')
   @allure.title('功能寻址-默认会话-测试DTC扩展老化数据-老化计数器')
   @allure.description('测试功能寻址默认会话下的DTC扩展数据记录-老化计数器')
   def test_DTCS_Failureforgetcounter_Defaul_Func(self, action, Driver):
      iStep = 1
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 1, iStep, False, 'UDSFun', 'ClearFault')
      
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 09 02 00', 0, iStep, False, 'UDSFun', 'noClearFault')
      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 3, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 00', 0, iStep, False, 'UDSFun', 'noClearFault')

      iStep = Driver['CAN'].restartETC_11(Driver, iStep, 3)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 01', 0, iStep, False, 'UDSFun', 'noClearFault')

      for i in range(3):
         # ECU下电再次上电
         iStep = Driver['CAN'].restartETC_11(Driver, iStep, 3)
         iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 ' + format(i+2, '02X'), 0, iStep, False, 'UDSFun', 'noClearFault')

      iStep = Driver['CAN'].restartETC_11(Driver, iStep, 3)
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 09 02 00', 0, iStep, False, 'UDSFun', 'noClearFault')
      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 3, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 00', 0, iStep, False, 'UDSFun', 'noClearFault')

      iStep = Driver['CAN'].restartETC_11(Driver, iStep, 3)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 01', 0, iStep, False, 'UDSFun', 'noClearFault')
      
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '14 FF FF FF', '54', 0, iStep, False, 'UDSFun', 'noClearFault')
      time.sleep(2)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 0, iStep, False, 'UDSFun', 'noClearFault')

   
   @allure.severity('normal')
   @allure.title('功能寻址-扩展会话-测试DTC扩展老化数据-老化计数器')
   @allure.description('测试功能寻址扩展会话下的DTC扩展数据记录-老化计数器')
   def test_DTCS_Failureforgetcounter_Extended_Func(self, action, Driver):
      iStep = 1
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 3, iStep, False, 'UDSFun', 'ClearFault')
      
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 09 02 00', 0, iStep, False, 'UDSFun', 'noClearFault')
      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 00', 0, iStep, False, 'UDSFun', 'noClearFault')

      iStep = Driver['CAN'].restartETC_11(Driver, iStep, 3)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 01', 3, iStep, False, 'UDSFun', 'noClearFault')

      for i in range(3):
         # ECU下电再次上电
         iStep = Driver['CAN'].restartETC_11(Driver, iStep, 3)
         iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 ' + format(i+2, '02X'), 3, iStep, False, 'UDSFun', 'noClearFault')

      iStep = Driver['CAN'].restartETC_11(Driver, iStep, 3)
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)

      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 09 02 00', 3, iStep, False, 'UDSFun', 'noClearFault')
      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 00', 0, iStep, False, 'UDSFun', 'noClearFault')

      iStep = Driver['CAN'].restartETC_11(Driver, iStep, 3)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 01', 3, iStep, False, 'UDSFun', 'noClearFault')
      
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '14 FF FF FF', '54', 0, iStep, False, 'UDSFun', 'noClearFault')
      time.sleep(2)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 0, iStep, False, 'UDSFun', 'noClearFault')
   
   @allure.severity('normal')
   @allure.title('功能寻址-默认会话-测试DTC扩展老化数据-老化计数器-40')
   @allure.description('测试功能寻址默认会话下的DTC扩展数据记录-老化计数器-40')
   def test_DTCS_Failureforgetcounter_40_Defaul_Func(self, action,  Driver):
      iStep = 1
      iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 1, iStep, False, 'UDSFun', 'ClearFault')
      
      # 设置电压为8v,生成低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 09 02 00', 0, iStep, False, 'UDSFun', 'noClearFault')
      # 设置电压为12v,恢复低压故障
      iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 00', 0, iStep, False, 'UDSFun', 'noClearFault')

      iStep = Driver['CAN'].restartETC_11(Driver, iStep, 3)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 01', 0, iStep, False, 'UDSFun', 'noClearFault')

      for i in range(42):
         # ECU下电再次上电
         iStep = Driver['CAN'].restartETC_11(Driver, iStep, 3)
         if i > 38:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 0, iStep, False, 'UDSFun', 'noClearFault')
         else:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 08 02 ' + format(i+2, '02X'), 0, iStep, False, 'UDSFun', 'noClearFault')
      
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '14 FF FF FF', '54', 0, iStep, False, 'UDSFun', 'noClearFault')
      time.sleep(2)
      iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, '19 06 91 17 16 02', '59 06 91 17 16 00', 0, iStep, False, 'UDSFun', 'noClearFault')

   